// 组织架构接口函数
import request from '@/utils/request'

// 获取部门列表接口
export const getDepartment = () => request({
  url: '/company/department'
})

// 获取负责人列表
export const getManagers = () => request({
  url: '/sys/user/simple'
})

// 新增子部门接口
export const addDepartment = data => request({
  url: '/company/department',
  method: 'POST',
  data
})

// 获取部门详情接口 编辑部门
export const getDetails = (id) => request({
  url: `/company/department/${id}`
})

// 修改部门详情接口
export const updateDepartment = (data) => request({
  url: `/company/department/${data.id}`,
  method: 'PUT',
  data
})

// 删除部门
export const delDepartment = id => request({
  method: 'DELETE',
  url: `/company/department/${id}`
})
